<?php
/*
 * @Author: 杨红兵
 * @Date: 2022-10-04 16:54:07
 * @Last Modified by: 杨红兵
 * @Last Modified time: 2022-10-05 10:35:07
 */

namespace app\libraries\utils\command;

use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputInterface;
use think\console\Input;

class InputStyle implements InputInterface
{
    /**
     * 真实的输入类
     *
     * @var Input
     * @Author YangHB
     * @DateTime 2022-10-04 16:55:51
     *
     */
    protected Input $input;

    public function __construct(Input $input)
    {
        $this->input = $input;
    }

    public function getFirstArgument()
    {
        return $this->input->getFirstArgument();
    }

    public function hasParameterOption($values, bool $onlyParams = false)
    {
        return $this->intput->hasParameterOption($values);
    }

    public function getParameterOption($values, $default = false, bool $onlyParams = false)
    {
        return $this->input->getParameterOption($values, $default);
    }

    public function bind(InputDefinition $definition)
    {
        /* 与 TP 的类不一至
        $this->input->bind($definition);
        */
    }

    public function validate()
    {
        $this->input->validate();
    }

    public function getArguments()
    {
        return $this->input->getArguments();
    }

    public function getArgument(string $name)
    {
        return $this->input->getArgument($name);
    }

    public function setArgument(string $name, $value)
    {
        $this->input->setArgument($name, $value);
    }

    public function hasArgument(string $name)
    {
        return $this->input->hasArgument($name);
    }

    public function getOptions()
    {
        return $this->input->getOptions();
    }

    public function getOption(string $name)
    {
        return $this->input->getOption($name);
    }

    public function setOption(string $name, $value)
    {
        $this->input->setOption($name, $value);
    }

    public function hasOption(string $name)
    {
        return $this->input->hasOption($name);
    }

    public function isInteractive()
    {
        return $this->input->isInteractive();
    }

    public function setInteractive(bool $interactive)
    {
        $this->input->setInteractive($interactive);
    }
}
